package com.xinpu.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.stream.Stream;

@Getter
@AllArgsConstructor
public enum UserEnum {
    STATUS_O(0, "未跟进"),
    STATUS_1(1, "跟进中"),
    STATUS_2(2, "已完成");



    private Integer value;
    private String desc;

    public static UserEnum toType(int value) {
        return Stream.of(UserEnum.values())
                .filter(p -> p.value == value)
                .findAny()
                .orElse(null);
    }
}
